       <?php
	   $row = $result[0];
	if($num_lang > 1)   $row_en = $result[1];

	    echo form_open_multipart('admin/product/update/'.$row['prod_id']); ?>	<!-- start title -->
		<div class="title corners_top" style="float:left;width:200px;"><h6 style="color:#900;" id="forms"><?php echo $title; ?></h6></div><!-- end title -->
        		<div class="proccess_bar">



    <ul class="menu_bar">
    <li><?php
	$data = array('name' => 'update', 'value' => ' ','class'=>'delete-1', 'id' => 'save');
	 echo form_submit($data);?> <!--<a href="#" ><span class="save-1"> </span>Save</a> -->
     Lưu
     </li>

     <li> <?php
	 $data = array('name' => 'close', 'value' => ' ','class'=>'delete-1', 'id' => 'cancel');

	 echo form_submit($data); ?>
     Hủy<!--<a href="#" ><span class="cancel-1"></span>Cancel</a>--></li>

    </ul>




 </div>
		<div class="content">

       	<div class="form" >



        <?php // echo '<p class="title">'.$this->lang->line('title_user_info').'</p>';
 if(isset($missing) && is_array($missing) )
   {

   echo ' <div><a href="javascript:();" title="Succes box" class="box error corners"><span class="close">&nbsp;</span>';
   foreach($missing as $item)
   {
   		echo $item."<br />";
   }
   echo "</a></div>";
   }



   	// file upload
	$code = "img";
	$label =$this->lang->line('image');



	//$data = array('name' =>$code, 'size' =>'20', 'value' => set_value($code));

//	echo form_upload($data);
	?>

    <p>

    <h6 style="float:left;width:130px;" >Mới  &nbsp; &nbsp; &nbsp;</h6><input style="height:25px;" type="checkbox" name="new" <?php echo ($row['prod_new'] == 1) ? 'checked="checked"':'' ;?> value="1" />
	</p>
    <p>
     <h6 class="t_float" style="clear:left"><?php echo 	$label =$this->lang->line('image'); ?></h6>
     <div class="images">
		<input type="text" id="fileName" class="file_input_textbox corners_left" readonly="readonly" />
 			<div class="file_input_div">
				<input type="button" value="" class="file_input_button" />
				<input type="file" name="img" id="img" class="file_input_hidden" onchange="javascript: document.getElementById('fileName').value = this.value" />
			</div>
	</div>
         <?php if($row['prod_image'] != "") { echo $row['prod_image'] ;?>   <span> <a href="<?php echo base_url().'admin/product/del_image/'.$row['prod_id'];?>" style="color:#900;font-weight:bold">Xóa </a></span>
	</p>
  <p>
 <?php }
  $option[] = '--- Chọn Loại --- ';
  	 if(!empty($cate))
	 {
		 foreach($cate as $item)
		 {
			 $option[$item['cat_id']]= $item['cat_name'];
		 }
	 }

  echo '<div >';
  	echo '<h6  class="t_float">','Loại sản phẩm','</h6>', form_dropdown('cate',$option,$row['prod_cate']).' <font color="red" style="font-weight:bold">(*)</font>';
	echo '</div>';

	echo '<div style="clear:left"></div>';
  ?>
  </p>
  <p>
   <?php
 // $manufacture[] = '--- Chọn Loại --- ';
  	 if(!empty($manu))
	 {
		 foreach($manu as $item)
		 {
			 $manufacture[$item['ori_id']]= $item['ori_name'];
		 }
	 }

  echo '<div >';
  	echo '<h6 class="t_float">','Xuất xứ','</h6>', form_dropdown('manu',$manufacture,$row['prod_cate']);
	echo '</div>';

	echo '<div style="clear:left"></div>';
  ?>
  </p>
  <p>
  <h6 class="t_float2"><?php echo 'Mã sản phẩm' ?></h6>
  <?php




	$code = "prod_code";

	$data = array('name' =>$code,'class'=>'large_input corners float' ,'id' => $code, 'value' =>html_entity_decode($row['prod_code'],ENT_QUOTES,'UTF-8'));
	//echo '<p>';

		if (! empty($missing) && array_key_exists($code, $missing))

		 echo form_input($data, set_value($code)),'<span class="info_error">error</span>';

	else
	  echo form_input($data, set_value($code));

//	echo '</p>';


	?>
</p>

    <p>
    <?php


	$code = "price";
	$label ="Vietnamese";
	echo '<h6 class="t_float2">Giá</h6>';
//echo '<div >';
	$data = array('name' =>$code,'class'=>'large_input corners' ,'id' => $code, 'value' => $row['prod_price']);
	//echo '<p>';

		if (! empty($missing) && array_key_exists($code, $missing))

		 echo form_input($data, set_value($code)),'<span class="info_error">error</span>';

	else
	  echo  form_input($data, set_value($code));

	//echo '</p>';

	//echo '</div>';
?>
</p>
<p>
<h6><?php echo $this->lang->line('news_title'); ?></h6>
<?php

	//title  vi

echo '<div class="inner">';
	$code = "title_vi";
	$label ="Vietnamese".' <font color="red" style="font-weight:bold">(*)</font>';
	$data = array('name' =>$code,'class'=>'large_input corners' ,'id' => $code, 'value' =>html_entity_decode($row['prod_name'],ENT_QUOTES,'UTF-8'));
	echo '<div  class="t_float2">',($label),'</div>';
	if (! empty($missing) && array_key_exists($code, $missing))

		 echo form_input($data, set_value($code)),'<span class="info_error">error</span>';

	else
	  echo form_input($data, set_value($code));


	echo '</div>';

	if($num_lang > 1){
	//title en

	echo '<div class="inner">';
	$code = "title_en";
	$label ="English".' <font color="red" style="font-weight:bold">(*)</font>';


echo '<div  class="t_float2">',($label),'</div>';

	$data = array('name' =>$code,'class'=>'large_input corners',  'value' => html_entity_decode($row_en['prod_name'],ENT_QUOTES,'UTF-8'));

	//echo '<p>';

		if (! empty($missing) && array_key_exists($code, $missing))

		 echo form_input($data, set_value($code)),'<span class="info_error">error</span>';

	else
	  echo form_input($data, set_value($code));

	//echo '</p>';

	echo '</div>';
	}



?>
</p>
<p>
<h6><?php echo $this->lang->line('news_info'); ?></h6>
<?php

			//direction vietname
$code = "direction_vi";
	$label ="Vietnamese";
	echo '<p>';
	echo '<div class="t_float2"> '.$label.'</div>';
	echo '<div class="float">';



	$data = array('name' =>$code,'class'=>'large_input corners' ,'id' => $code, 'value' =>  $row['prod_content']);

	echo '<div class="textarea"> '.form_textarea($data).'</div>';

	echo '</div>';
echo '</p>';
		if($num_lang > 1)
		{

		//direction english
$code = "direction_en";
	$label ="English";
	echo '<div class="t_float2"> '.$label.'</div>';
	echo '<div class="float">';

	$data = array('name' =>$code, 'id' => $code,'class'=>'large_input corners', 'value' =>  $row_en['prod_content']);

	echo '<div class="textarea">'.form_textarea($data).'</div>';

	echo '</div>';
		}


?>
</p>
<h6 class="t_float" > Trạng thái </h6>
<div class="float radio"><input  type="radio" name="status" id="status" value="1" <?php echo ($row['prod_status']== 1) ?  'checked="checked"' :  '';    ?> />Hiện
<input  type="radio" name="status" id="status" value="0 " <?php  echo($row['prod_status']!= 1) ?  'checked="checked"':  ''; ?> /> ẩn

</div>
<?php




	echo form_close(); //FORM END



	?>
     </div>
     </div>


<script type="text/javascript">

	CKEDITOR.replace("direction_vi");
	CKEDITOR.replace("direction_en");

</script>
